package cn.fboost.mtos.dto.request;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;

/**
 * 修改商品请求实体
 */
@Data
public class ProductUpdateRequest {
    @NotNull(message = "商品ID不能为空")
    @Positive(message = "商品ID有误")
    private Integer id;
    @Positive(message = "分类ID有误")
    private Integer categoryId;
    @Length(min = 1, max = 20, message = "商品名称长度为1-20字符")
    private String name;
    @DecimalMin(value = "0.01", message = "价格不能小于0.01")
    private Double price;
    private String image;
    private String describe;
    private Boolean sellOut;
    private Boolean offShelf;
}
